package cn.jiaqiang.chatgpt.data.domain.openai.model.entity;

import cn.jiaqiang.chatgpt.data.domain.openai.model.valobj.UserAccountStatusVO;
import cn.jiaqiang.chatgpt.data.types.common.Constants;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description: 用户账户实体
 * User: 86187
 * Date: 2024-04-02
 * Time: 16:23
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class UserAccountEntity implements Serializable {

    /** 用户在本系统的唯一标识 */
    private Long userId;
    /** 用户微信唯一标识 */
    private String openid;
    /** 总额度,次数 */
    private Integer totalQuota;
    /** 剩余额度 */
    private Integer surplusQuota;
    /** 可用模型 */
//    private List<String> allowModelTypeList;
    /** 用户状态: 0可用, 1冻结 */
    private UserAccountStatusVO userAccountStatusVO;

//    public void genModelTypes(String modelTypes) {
//        if (modelTypes == null || modelTypes.trim().isEmpty()) {
//            this.allowModelTypeList = Collections.emptyList();
//        } else {
//            String[] strings = modelTypes.split(Constants.SPLIT);
//            this.allowModelTypeList = Arrays.asList(strings);
//        }
//    }

}
